<?php
/**
 * Copyright 2011  SURFfoundation
 * 
 * This file is part of ESCAPE.
 * 
 * ESCAPE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ESCAPE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with ESCAPE.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information:
 * http://escapesurf.wordpress.com/
 * http://www.surffoundation.nl/
 * 
 * Contact: d.vierkant@utwente.nl
 * 
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3
 */
?>
<?php
/**
 * Menu
 */
class escape_setup_action_Menu extends escape_setup_Action
{
	public function handleRequest()
	{
		// list of actions and action names
		$this->requestAttributes['actions'] = array(
			'InstallFedoraSystemObjects' => array(
					'title' => 'Install Fedora system objects',
					'description' => 'ESCAPE needs a set of system object to be available in the Fedora repository. This option installs the system objects into the Fedora repository. Existing objects will be replaced.',
				),
			'CreateInitialAdministrator' => array(
					'title' => 'Create an initial administrator account',
					'description' => 'Creates an intial administrator account using the credentials supplied in the configuration file.',
				),
			'CheckObjectConsistency' => array(
					'title' => 'Check object consistency',
					'description' => 'Checks basic object consistency by loading all items and checking the aggregation -> aggregated resource relations.',
				),
			'RebuildIndexes' => array(
					'title' => 'Rebuild indexes',
					'description' => 'Rebuilds the triple store index using the data stored in Fedora.',
				),
			'RebuildResourceUris' => array(
					'title' => 'Rebuild resource URIs',
					'description' => 'Rebuilds object resource URIs based on the server name in the configuration file. Use this option only when the current resource URIs are corrupted or if the server name changed.',
				),
			'PhpInfo' => array(
					'title' => 'PHP info',
					'description' => 'Shows the PHP configuration settings.',
				),
			'ShowObject' => array(
					'title' => 'Show object',
					'description' => 'Show the data stored for an object.',
				),
			'DeleteObject' => array(
					'title' => 'Delete object',
					'description' => 'Delete (problematic) objects.',
				),
			'ReplaceProperty' => array(
					'title' => 'Replace a property',
					'description' => 'Replace a property for all objects in this ESCAPE instance.',
				),
			'EditFedoraDataStream' => array(
					'title' => 'Edit Fedora data stream',
					'description' => 'Edit the content of a Fedora data stream.',
				),
			'PurgeAllObjects' => array(
					'title' => 'Purge all objects',
					'description' => 'Purge ALL objects in this ESCAPE instance.',
				),
		);
		
		if($this->requestAttributes['repositoryConfig']['saml']['enabled'])
		{
			$this->requestAttributes['actions']['DebugSaml'] = array(
				'title' => 'SAML debug',
				'description' => 'Show SAML debug information, does not perform provisioning after logon. Allows you to test the SAML configuration.',
			);
		}
		
		return 'Menu';
	}
}